<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:f="livcos.org/ns/xslt/function"
  xmlns="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="f">
  
  <xsl:import href="../base.xsl"/>
  
	<xsl:template match="/*">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
				<style type="text/css">
					body {
						background-color: #FEFEFF;
						font-size: 80%;
						font-family: Verdana;
					}
					
					a {
						text-decoration: none;
					}
					
				</style>
			</head>
			<body>
				<h1>Exception!</h1>
				<xsl:apply-templates select="exception" mode="msg"/>
				<p><a href="{f:caller-uri('/sysjob.html')}?job={local-name()}">See job protocol...</a></p>
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="exception" mode="msg">
    <p>
      <xsl:for-each select="ancestor::exception">
        <xsl:text>- </xsl:text>        
      </xsl:for-each>
      <xsl:choose>
        <xsl:when test="message">
          <xsl:value-of select="message"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="@type"/>
        </xsl:otherwise>
      </xsl:choose>
    </p>
    <xsl:apply-templates select="exception" mode="msg"/>
	</xsl:template>
	
</xsl:stylesheet>
